/**
 * 业务接口 -> 原料采购,物资管理
 */
import { httpJ } from '../conf/index-json'
import { baseURL, baseURLou } from '../conf/index'
import qs from 'qs'
import store from '@/store'

/*************************************** 原料采购模块/采购模式API *******************************************/
// 原料采购/基础配置/采购模式配置列表
export const selectFoodBookServicePurchasingPattern = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/FoodBookService/getPurchasingPattern`, params)
		.then((res) => res.data)
}

// 原料采购/基础配置/采购模式配置/添加采购模式
export const saveFoodBookServicePurchasingPattern = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/FoodBookService/savePurchasingPattern`, params)
		.then((res) => res.data)
}

// 原料采购/基础配置/采购模式配置/获取编辑采购模式
export const selectFoodBookServicePurchasingPatternDtl = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/FoodBookService/getPurchasingPatternDtl`, params)
		.then((res) => res.data)
}

// 原料采购/基础配置/采购模式配置/删除采购模式
export const deleteFoodBookServicePurchasingPattern = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/FoodBookService/deletePurchasingPattern`, params)
		.then((res) => res.data)
}

// 原料采购/基础配置/采购模式配置/设置默认采购模式
export const settingFoodBookServicePurchasingPattern = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/FoodBookService/settingDefaultPattern`, params)
		.then((res) => res.data)
}

// 原料采购/基础配置/供应商区分/table列表数据
export const getPurchasingSurchasingList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/purchasing/supplier/list`, { params })
		.then((res) => res.data)
}

// 原料采购/基础配置/采购模式配置/设table列表更改启用状态
export const updatePurchasingSupplierDisable = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/supplier/disable`, params)
		.then((res) => res.data)
}

// 原料采购/基础配置/供应商区分/供应种类
export const getApiPurchasingLocalfoodtypeList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/purchasing/localfoodtype/list`, { params })
		.then((res) => res.data)
}

// 原料采购/基础配置/供应商区分/供应商添加前效验
export const postApiSupplierIssuppliername = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/supplier/issuppliername`, params)
		.then((res) => res.data)
}

// 原料采购/基础配置/供应商区分/供应商添加
export const postApiPurchasingSupplierSave = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/supplier/save`, params)
		.then((res) => res.data)
}

// 原料采购/基础配置/供应商区分/供应商编辑
export const postApiPurchasingSupplierUpdate = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/supplier/update`, params)
		.then((res) => res.data)
}

// 原料采购/基础配置/供应商区分/下载供应商模板
export const getApiPurchasingDownloadSupplierExcel = `${baseURLou}/purchasing/downloadSupplierExcel`

// 原料采购/基础配置/供应商区分/导入供应商清单
export const postApiPurchasingExcelImportSupplyInfoDao = (params = {}) => {
	// 文件上传
	return httpJ
		.post(`${baseURLou}/purchasing/excelImportSupplyInfoDao`, params, {
			headers: { 'Content-Type': 'multipart/form-data' }
		})
		.then((res) => res.data)
}

// 原料采购/基础配置/供应商区分/导出供应商列表
export const postApiPurchasingExportSupplierExcel = (
	startDate,
	stopDate,
	supplierName,
	materialClass
) =>
	`${baseURLou}/purchasing/exportSupplierExcel?startDate=${startDate}&stopDate=${stopDate}&supplierName=${supplierName}&materialClass=${materialClass}&token=${store.state.vuex_user.token}`

// 原料采购/基础配置/供应商区分/商品种类列表
export const getApiProductcategoryList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/purchasing/productcategory/list`, { params })
		.then((res) => res.data)
}

// 原料采购/基础配置/供应商区分/添加商品种类/供应种类接口
export const getCategoryListWithSupplyStatus = (params = {}) => {
	return httpJ
		.get(
			`${baseURLou}/purchasing/productcategory/getCategoryListWithSupplyStatus`,
			{ params }
		)
		.then((res) => res.data)
}

// 原料采购/基础配置/供应商区分/添加商品种类
export const saveApiProductcategory = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/productcategory/save`, params)
		.then((res) => res.data)
}

// 原料采购/基础配置/供应商区分/修改商品种类
export const updateApiProductcategory = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/productcategory/update`, params)
		.then((res) => res.data)
}

// 原料采购/基础配置/供应商区分/删除资质图片
export const deleteApiCertificationPicture = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/supplier/deleteCertificationPicture`, params)
		.then((res) => res.data)
}

// 原料采购/基础配置/供应商区分/删除商品种类列表数据
export const deleteApiProductcategory = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/purchasing/productcategory/delete`, { params })
		.then((res) => res.data)
}

// 原料采购/基础配置/供应商区分/更改状态
export const updateApiProductcategorySwitchStatus = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/purchasing/productcategory/switchStatus`, { params })
		.then((res) => res.data)
}

/******************************************************* 原料采购模块/采购单生成API *********************************************************/
// 原料采购/采购单生成（查询根据食谱获取id根据id获取采购单生成列表）
export const getApiFoodBookServiceGetPurchasingPlanId = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/FoodBookService/getPurchasingPlanId`, { params })
		.then((res) => res.data)
}

// 原料采购/采购单生成列表
export const postApiFoodBookServiceGetPurchasingInfoByIdDtl = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/FoodBookService/getPurchasingInfoByIdDtl`, params)
		.then((res) => res.data)
}

// 原料采购/采购单生成/保存更改采购单需求
export const postApiFoodBookServiceUpdatePurchasingPlanRecord = (
	params = {}
) => {
	return httpJ
		.post(`${baseURLou}/FoodBookService/updatePurchasingPlanRecord`, params)
		.then((res) => res.data)
}

// 原料采购/采购单生成/删除
export const postApiFoodBookServiceDelPurchasingRecord = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/FoodBookService/delPurchasingRecord`, params)
		.then((res) => res.data)
}

// 原料采购/采购单生成/批量删除
export const deleteAllPurchasingRecord = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/FoodBookService/deleteBatchPurchasingRecord`, params)
		.then((res) => res.data)
}

// 原料采购/采购单生成/采购单查询/导出采购单Excel文件
export const getApiPurchasingDownloadPurchasingSummaryExcel = `${baseURLou}/purchasing/downloadPurchasingSummaryExcel?token=${store.state.vuex_user.token}`
// 原料采购/食材种类查询食材（物料）分类（大类和小类)
export const getBasicMaterialType = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/basic/materialType`, { params })
		.then((res) => res.data)
}

// 原料采购/采购单生成/查看供应商采购列表/采购清单列表
export const postApiPurchasingPurchasinglist = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/purchasinglist`, params)
		.then((res) => res.data)
}

// 原料采购/采购单生成/查看供应商采购列表/生成采购需求汇总表
export const postApiPurchasingSupplierPurchasingPurchasingSummary = (
	params = {}
) => {
	return httpJ
		.post(
			`${baseURLou}/purchasing/supplierPurchasing/purchasingSummary`,
			params
		)
		.then((res) => res.data)
}

// 原料采购/购单生成/查看供应商采购列表/生成采购单
export const getApiPurchasingPoorderelistGeneratePoOrder = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/purchasing/poorderelist/generatePoOrder`, { params })
		.then((res) => res.data)
}

// 原料采购/采购单生成/查看供应商采购列表/下一步生成供应商采购清单
export const postApiFoodBookServiceAuditConfirmPurchasingPlan = (
	params = {}
) => {
	return httpJ
		.post(`${baseURLou}/FoodBookService/auditConfirmPurchasingPlan`, params)
		.then((res) => res.data)
}

// 原料采购/采购单生成/下一步生成供应商采购清单前效验
export const postApiFoodBookServiceDelPurchasingFoodExamine = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/FoodBookService/purchasingFoodExamine`, params)
		.then((res) => res.data)
}

//原料采购/采购单生成/查询采购清单列表
export const postApiPurchasingPurchasingdtlList = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/purchasingdtllist`, params)
		.then((res) => res.data)
}

/******************************************************* 原料采购模块/采购单查询API *********************************************************/
// 原料采购 -采购单查询 - 列表
export const postApiPurchasingGetAllPurchasingPlanPage = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/getAllPurchasingPlanPage`, params)
		.then((res) => res.data)
}

// 原料采购-采购单查询-导入采购单Excel文件前效验时间段内是否已导入采购需求
export const postApiPurchasingThisWeekIsExistInPortPurchasingExcel = (
	params = {}
) => {
	return httpJ
		.post(
			`${baseURLou}/purchasing/thisWeekIsExistInPortPurchasingExcel`,
			params
		)
		.then((res) => res.data)
}

// 原料采购-采购单查询-导入采购单Excel文件
export const postApiPurchasingInportPurchasingPlanExcel = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/inportPurchasingPlanExcel`, params)
		.then((res) => res.data)
}

// 原料采购-采购单查询-添加采购单
export const postApiFoodBookServiceAddPurchasingPlan = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/FoodBookService/addPurchasingPlan`, params)
		.then((res) => res.data)
}

// 原料采购-采购单查询-导出Tbale表格单个采购计划
export const postApiPurchasingPurchasingSummaryPoOrde = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/purchasingSummaryPoOrder`, params)
		.then((res) => res.data)
}

// 原料采购-采购单查询-查看采购单-查看采购单列表
export const postApiPurchasingPoorderlist = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/poorderlist`, params)
		.then((res) => res.data)
}

// 原料采购-采购单查询-查看采购单-查看二维码
export const postApiPurchasingPoorderlistQrcode = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/poorderlist/qrcode`, params)
		.then((res) => res.data)
}

// 原料采购-采购单查询-查看采购单-导出Excel
export const postApiPurchasingInportPoOrderExcel = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/inportPoOrderExcel`, params)
		.then((res) => res.data)
}

// 原料采购-采购单查询-查看采购单-采购食材列表
export const postApiPurchasingPoorderdtllist = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/poorderdtllist`, params)
		.then((res) => res.data)
}

// 原料采购-采购单查询-查看采购单-供应商名称
export const getApiPurchasingSupplierName = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/purchasing/supplier/name`, { params })
		.then((res) => res.data)
}

// 原料采购-采购单查询-查看采购单-保存采购单
export const postApiPurchasingManualSavePoOrder = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/manualSavePoOrder`, params)
		.then((res) => res.data)
}

// 原料采购-采购单查询-查看采购单-修改采购单
export const postApiPurchasingUpdatePoOrderDtl = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/updatePoOrderDtl`, params)
		.then((res) => res.data)
}

// 原料采购-采购单查询-查看采购单-删除采购单
export const postApiPurchasingDeletePoOrderDtlById = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/deletePoOrderDtlById`, params)
		.then((res) => res.data)
}

// 原料采购-采购单查询-查看采购单-添加采购蔬菜列表table数据
export const postApiPurchasingSelectMaterialSupplyStatusListPage = (
	params = {}
) => {
	return httpJ
		.post(`${baseURLou}/purchasing/selectMaterialSupplyStatusListPage`, params)
		.then((res) => res.data)
}

// 原料采购-采购单查询-查看采购单-添加采购食材数据
export const postApiPurchasingInsertPoOrderDtl = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/insertPoOrderDtl`, params)
		.then((res) => res.data)
}

// 后厨原料采购 - 采购单管理 - 审核
export const postPurchasePlanReview = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/purchasePlanReview`, params)
		.then((res) => res.data)
}

// 后厨原料采购 - 采购单管理 - 审核激流
export const postPurchasePlanReviewRecord = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/purchasing/getPurchasePlanReviewRecord`, params)
		.then((res) => res.data)
}

/***********************************  后厨物资管理  ********************************************/
// 后厨物资管理设备管理 - 仓库信息 - 列表
export const getBasstockList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/basstock/list`, { params })
		.then((res) => res.data)
}

// 后厨物资管理设备管理 - 仓库信息 - 列表
export const getBasstockSelectList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/basstock/selectList`, { params })
		.then((res) => res.data)
}

// 后厨物资管理设备管理 - 仓库信息 - 删除仓库
export const deleteGetGoodsBasstock = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/basstock/delete`, { params })
		.then((res) => res.data)
}

// 后厨物资管理设备管理 - 仓库信息 -保存仓库
export const addPostApiGoodsBasstockSave = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/basstock/save`, params)
		.then((res) => res.data)
}

// 后厨物资管理设备管理 - 仓库信息 - 仓库编号重复性检查
export const seleteCheckOuterNoDuplicate = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/basstock/checkOuterNoDuplicate`, { params })
		.then((res) => res.data)
}
// 后厨物资管理 - 人员管理 - 获取操作人员信息
export const postApiOperatorInfoByPage = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/getOperatorInfoByPage`, params)
		.then((res) => res.data)
}
// 后厨物资管理 - 人员管理 - 获取单位信息
export const getUnitInfo = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/getUnitInfo`, { params })
		.then((res) => res.data)
}
// 后厨物资管理 - 人员管理 - 新增 / 修改物资称操作人员信息
export const postApisaveOperatorInfo = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/saveOperatorInfo`, params)
		.then((res) => res.data)
}
// 后厨物资管理 - 人员管理 - 图片上传
export const postApiImageUpload = (params = {}) => {
	// 文件上传
	return httpJ
		.post(`${baseURLou}/goods/image/upload`, params, {
			headers: { 'Content-Type': 'multipart/form-data' }
		})
		.then((res) => res.data)
}
// 修改仓库
export const updatePostApiGoodsBasstock = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/basstock/update`, params)
		.then((res) => res.data)
}

// 后厨物资管理设备管理 - 桌面秤列表
export const getDeviceList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/device/list`, { params })
		.then((res) => res.data)
}

// 后厨物资管理设备管理 - 添加设备
export const addDevice = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/device/save`, params)
		.then((res) => res.data)
}

// 后厨物资管理设备管理 - 编辑设备
export const updateDevice = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/device/update`, params)
		.then((res) => res.data)
}

// 后厨物资管理设备管理 - 设备管理 - 删除设备
export const deleteTouchscaleList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/device/delete`, { params })
		.then((res) => res.data)
}

// 后厨物资管理设备管理 - 设备管理 - 启用/禁用设备
export const updateTransformDeviceStatus = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/device/transformDeviceStatus`, { params })
		.then((res) => res.data)
}

// 后厨物资管理设备管理 - 入库验收
export const getGoodsStockbilList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/stockbill/list`, { params })
		.then((res) => res.data)
}

//后厨物资管理设备管理 - 验收Table列表采购单导出
export const postGeneratePoStockbillIportExcel = (stockId) =>
	`${baseURLou}/goods/generatePoStockbillIportExcel?stockId=${stockId}`
// export const postGeneratePoStockbillIportExcel = (params) => {
// 	return httpJ
// 		.get(`${baseURLou}/goods/generatePoStockbillIportExcel`, { params })
// 		.then((res) => res.data)
// }

//后厨物资管理 入库验收 导出称重图片
export const onExportImage = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/exportStockBillWeightPic`, params, {
			responseType: 'blob'
		})
		.then((res) => res.data)
}

//确认校验
export const valieDateExamine = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/examinePoStockBillData`, params)
		.then((res) => res.data)
}

// 后厨物资管理设备管理 - 物资入库验收Table确认审核
export const postApiGoodsHandaworkCheckstockbill = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/handawork/checkstockbill`, params)
		.then((res) => res.data)
}

// 后厨物资管理设备管理 - 采购单入库列表
export const getApiGoodsSelectNoDownloadAndNoStockBillPoOrderList = (
	params = {}
) => {
	return httpJ
		.get(`${baseURLou}/goods/selectNoDownloadAndNoStockBillPoOrderList`, {
			params
		})
		.then((res) => res.data)
}

// 后厨物资管理 - 获取所有入库方式
export const getInStorageWays = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/getInStorageWays`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 采购单入库-导入
export const postApiGoodsInsertPoStockbillByPoOrder = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/insertPoStockbillByPoOrder`, params)
		.then((res) => res.data)
}

//后厨物资管理 - 物资入库验收清单报表导出
export const postApiGoodsStockbillStockbillInvertory = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/stockbill/stockbillInvertory`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 获取物资供应商名称
export const getApiGoodsHandaworkSuppliername = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/handawork/suppliername`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 - 手工入库添加列表数据
export const postApiGoodsHandaworkList = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/handawork/list`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 - 手工入库登记明细
export const postApiGoodsSelectBasProductListPage = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/selectBasProductListPage`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 - 获取物资食材种类
export const getApiGoodsHandaworkItem = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/handawork/item`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 -添加手工入库物资登记
export const postApiGoodsHandaworkSave = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/handawork/save`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 -删除手工入库列表数据
export const postApiGoodsHandaworkDelete = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/handawork/delete`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 - 编辑手工入库列表数据
export const postApiGoodsHandaworkUpdate = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/handawork/update`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 - 保存手工入库
export const postApiGoodsHandaworkSaveStockbill = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/handawork/savestockbill`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 - 物资入库验收详情添加明细-添加入库量
export const postApiGoodsStockbillSavepostockbll = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/stockbill/savepostockbill`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 - 修改手工入库物资登记添加量
export const postApiGoodsStockbillUpdatepostockbill = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/stockbill/updatepostockbill`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 - 入库验收上传信息二维码效验
export const postApiGoodsAnalysisDeliveryBillQRCodeVerify = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/analysisDeliveryBillQRCodeVerify`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 -入库验收上传信息二维码保存
export const postApiGoodsAnalysisDeliveryBillQRCode = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/analysisDeliveryBillQRCode`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 - 物资入库验收详情列表
export const postApiGoodsStockbillGet = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/stockbill/get`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 - 物资入库验收详情- 判断是否可以操作添加，编辑等按钮（1确认后，2.电子秤入库）
export const postApiGoodsStockbillCanModify = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/stockbill/canModify`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 - 物资入库汇总表
export const selectApiGoodsStockbillSummaryList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/stockbill/summaryList`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 - 物资入库汇总表 - 导出-入库物资汇总列表
export const postApiPurchasingExportSummaryList = (
	startDate,
	supplierId,
	goodsTypeName,
	stockId,
	goodsName
) =>
	`${baseURLou}/goods/stockbill/exportSummaryList?startDate=${startDate}&supplierId=${supplierId}&goodsTypeName=${goodsTypeName}&stockId=${stockId}&goodsName=${goodsName}`

// 后厨物资管理 - 入库验收 - 导出验收二维码
export const getExportGoodsStockQrcode = (id) =>
	`${baseURLou}/goods/stockbill/exportGoodsStockQrcode?id=${id}`

// 后厨物资管理 - 物资领用单
export const postApiGoodsReceiveorderList = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/receiveorder/list`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 物资领用单生成
export const getApiPurchasingExportSummaryList = (id) =>
	`${baseURLou}/goods/goodsMaterialRequisition?id=${id}`

// 后厨物资管理 - 确认领用单
export const postApiReceiveorderCheckstatus = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/receiveorder/checkstatus`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 确认领用单-获取领用单二维码
export const postApiGoodsRriceiveorderQrcode = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/riceiveorder/qrcode`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 物资领用单 - 获取物资领用单
export const postApiGoodsPoinventroyReceivepoinventroys = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/poinventroy/receivepoinventroys`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 物资领用单 - 添加物资领用
export const postApiGoodsCreatereceivedtlSave = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/createreceivedtl/save`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 物资领用单 - 获取物料领用单添加列表
export const postApiGoodsCreatereceivedtlList = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/createreceivedtl/list`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 物资领用单 - 删除物料领用单
export const postApiGoodsCreatereceivedtlDelete = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/createreceivedtl/delete`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 物资领用单 - 获取当日食谱
export const postApiFoodBookServiceSelectPresentMealPlan = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/FoodBookService/selectPresentMealPlan`, params)
		.then((res) => res.data)
}

// 厨物资管理 - 物资领用单 - 食谱餐次所需领用食材
export const postApiGoodsSelectMealPlanTimesFoodList = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/selectMealPlanTimesFoodList`, params)
		.then((res) => res.data)
}

// 厨物资管理 - 物资领用单 - 提交保存物资领用单
export const postApiGoodsReceiveorderSave = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/receiveorder/save`, params)
		.then((res) => res.data)
}

// 厨物资管理 - 物资领用单 - 食谱餐次所需食材，全部添加到领用单
export const getGoodsCreatereceivedtlAddAllReceiveDtlFromFoodBook = (
	params = {}
) => {
	return httpJ
		.get(`${baseURLou}/goods/createreceivedtl/addAllReceiveDtlFromFoodBook`, {
			params
		})
		.then((res) => res.data)
}

// 厨物资管理 - 物资领用单 - 物资领用单详情
export const postApiReceiveorderGet = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/receiveorder/get`, params)
		.then((res) => res.data)
}

// 物资管理 - 出库登记 - 查询下级单位
export const getDepartmentOfCurrentUnit = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/basic/getDepartmentOfCurrentUnit`, { params })
		.then((res) => res.data)
}

// 厨物资管理 - 出库登记 - 出库登记列表数据
export const postApiGoodsOutStockBillList = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/outStockBill/list`, params)
		.then((res) => res.data)
}

// 厨物资管理 - 出库登记 - 物资出库库验收Table列表采购单导出
export const postApiGoodsGeneratePoStockbillIportExcel = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/generatePoOutStockbillIportExcel`, params)
		.then((res) => res.data)
}

// 厨物资管理 - 出库登记 -物资出库清单确认-审核
export const postApiGoodsOuthandaworkCheckoutstockbill = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/outhandawork/checkoutstockbill`, params)
		.then((res) => res.data)
}

// 厨物资管理 - 出库登记 - 手工出库列表
export const postApiGoodsOuthandaworkList = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/outhandawork/list`, params)
		.then((res) => res.data)
}

// 物资管理 - 出库登记 - 获取所有的出库方式
export const getOutStorageWays = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/getOutStorageWays`, { params })
		.then((res) => res.data)
}

// 厨物资管理 - 出库登记 - 手工出库列表删除添加出库数据
export const postApiGoodsOuthandaworkDelete = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/outhandawork/delete`, params)
		.then((res) => res.data)
}

// 厨物资管理 - 出库登记 - 手工出库列表保存出库数据
export const postApiGoodsOuthandaworkSaveoutstockbill = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/outhandawork/saveoutstockbill`, params)
		.then((res) => res.data)
}

// 厨物资管理 - 出库登记 - 获取规格数据
export const getGoodsSelectBasSpecificationList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/selectBasSpecificationList`, { params })
		.then((res) => res.data)
}

// 厨物资管理 - 出库登记 - 保存查看详情手工出库物资登记出库量
export const postApiGoodsOutStockBillSavepooutstockbill = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/outstockbill/savepooutstockbill`, params)
		.then((res) => res.data)
}

// 物资管理 - 出库登记 - 编辑查看详情手工出库物资登记出库量
export const postApiGoodsOutStockBillUpdatepooutstockbill = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/outstockbill/updatepooutstockbill`, params)
		.then((res) => res.data)
}

// 物资管理 - 出库登记 - 编辑出库量
export const updatePostOuthandawork = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/outhandawork/update`, params)
		.then((res) => res.data)
}

// 物资管理 - 出库登记 - 编辑出库量获取库存重量(修改后接口)
export const updateGoodsPoinventroyInfo = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/poinventroy/info`, { params })
		.then((res) => res.data)
}

// 物资管理 - 出库登记 - 出库登记保存出库重量
export const postApiGoodsOuthandaworkSave = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/outhandawork/save`, params)
		.then((res) => res.data)
}

// 物资管理 - 出库登记 - 获取领用单出库数据
export const getApiGoodsSelectNoDownloadAndNoOutStockbillSalesList = (
	params = {}
) => {
	return httpJ
		.get(`${baseURLou}/goods/selectNoDownloadAndNoOutStockbillSalesList`, {
			params
		})
		.then((res) => res.data)
}

// 物资管理 - 出库登记 - 采购单入库-导入
export const postApiGoodsInsertPoOutStockbillByPoOrderSales = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/insertPoOutStockbillByPoOrderSales`, params)
		.then((res) => res.data)
}

// 物资管理 - 出库登记 -获取验收出库单详情
export const postApiGoodsOutStockBillGet = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/outStockBill/get`, params)
		.then((res) => res.data)
}

// 物资管理 - 出库登记 -删除查看详情手工出库物资登记出库量
export const postApiGoodsOutStockBillDeletepooutstockbill = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/outstockbill/deletepooutstockbill`, params)
		.then((res) => res.data)
}
// 物资管理 - 出库登记 - 入库单出库
export const generateOutStockBillByStockBill = (params = {}) => {
	return httpJ
		.post(
			`${baseURLou}/goods/outStockBill/generateOutStockBillByStockBill`,
			params
		)
		.then((res) => res.data)
}
// 物资管理 - 出库登记 - 导出物资出库汇总表
export const postOutStockBillExportSummaryList = (
	startDate,
	goodsTypeName,
	stockId,
	goodsName
) =>
	`${baseURLou}/goods/outStockBill/exportSummaryList?startDate=${startDate}&goodsTypeName=${goodsTypeName}&stockId=${stockId}&goodsName=${goodsName}`

// 删除手工入库物资登记添加量
export const postApiGoodsStockbillDeletepostockbill = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/stockbill/deletepostockbill`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 入库验收 - 物资出库汇总表
export const selectOutStockBillSummaryList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/outStockBill/getSummaryList`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 出入库明细 - 出入库查询入库查询列表
export const selectStockBillEntityList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/stockbill/getStockBillEntityList`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 出入库明细 - 导出-出入库查询-入库查询列表
export const selectStockBillExportEntityList = (
	startDate,
	stopDate,
	productName,
	goodsCode,
	supplyId,
	inspectorName,
	billNo,
	storageway,
	stockId
) =>
	`${baseURLou}/goods/stockbill/exportStockBillEntityList?startDate=${startDate}&stopDate=${stopDate}&productName=${productName}&goodsCode=${goodsCode}&supplyId=${supplyId}&inspectorName=${inspectorName}&billNo=${billNo}&storageway=${storageway}&stockId=${stockId}&token=${store.state.vuex_user.token}`

// 后厨物资管理 - 出入库明细 - 验收单二维码
export const postApiGoodsStockbillQrcodeGoodsStock = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/stockbill/qrcodeGoodsStock`, params, {
			responseType: 'blob'
		})
		.then((res) => res.data)
}

// 后厨物资管理 - 出入库明细 - 导出Excel二维码
export const postApiGeneratePoStockbillIportExcelAndQRCode = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/generatePoStockbillIportExcelAndQRCode`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 出入库明细 - 出库查询列表
export const selectGetOutStockBillEntityList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/outStockBill/getOutStockBillEntityList`, {
			params
		})
		.then((res) => res.data)
}

// 后厨物资管理 - 库存查询 - 获取库存列表（库存查询）
export const getPoinventroyList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/getPoinventroyList`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 库存查询 - 导出-库存列表
export const exportPoinventroyList = (
	stockId,
	supplierId,
	goodsTypeName,
	productName
) =>
	`${baseURLou}/goods/exportPoinventroyList?stockId=${stockId}&supplierId=${supplierId}&goodsTypeName=${goodsTypeName}&productName=${productName}&token=${store.state.vuex_user.token}`

// 后厨物资管理 - 库存查询 - 生成盘点单
export const getGoodscheckGenerateCheck = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/goodscheck/generateCheck`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 库存查询 - 盘点记录 - 盘点记录列表
export const getGoodscheckList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/goodscheck/list`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 库存查询 - 盘点记录 - 导出
export const exportCheck = (id) =>
	`${baseURLou}/goods/goodscheck/exportCheck?id=${id}&token=${store.state.vuex_user.token}`

// 后厨物资管理 - 库存查询 - 盘点记录 - 物资盘点明细列表
export const getGoodscheckdtlList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/goodscheckdtl/list`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 库存查询 - 盘点记录 - 完成物资盘点
export const getGoodscheckFinishCheck = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/goodscheck/finishCheck`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 库存查询 - 盘点记录 - 保存物资盘点
export const postGoodscheckdtlUpdateCheckData = (params = {}) => {
	return httpJ
		.post(`${baseURLou}/goods/goodscheckdtl/updateCheckData`, params)
		.then((res) => res.data)
}

// 后厨物资管理 - 消耗汇总 - 消耗汇总一级列表
export const getPoinventroyConsumeList = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/poinventroy/getGoodsConsumeList`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 消耗汇总 - 消耗汇总二级列表
export const getGoodsConsumeDetails = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/poinventroy/getGoodsConsumeDetails`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 消耗汇总 - 设置默认仓库
export const setDefaultStock = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/basstock/setDefaultStock`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 消耗汇总 - 判断出库方式是否可以编辑
export const getOutStockBillCanModify = (params = {}) => {
	return httpJ
		.get(`${baseURLou}/goods/outStockBill/canModify`, { params })
		.then((res) => res.data)
}

// 后厨物资管理 - 出入库明细 - 导出接口
export const getOutStockBillEntityList = (
	startDate,
	stopDate,
	productName,
	goodsCode,
	supplyId,
	billNo,
	recipientDepartmentName,
	storageway,
	stockId
) =>
	`${baseURLou}/goods/outStockBill/exportOutStockBillEntityList?startDate=${startDate}&stopDate=${stopDate}&productName=${productName}&goodsCode=${goodsCode}&supplyId=${supplyId}&billNo=${billNo}&recipientDepartmentName=${recipientDepartmentName}&storageway=${storageway}&stockId=${stockId}&token=${store.state.vuex_user.token}`

/*************************************** 页面接口模板API *******************************************/
// GET 请求
export const getTopLevel = (params = {}) => {
	return httpJ
		.get(`${baseURL}/head/get_info`, { params })
		.then((res) => res.data)
}

// POST 请求
export const modifyTopLevelInfo = (params = {}) => {
	return httpJ
		.post(`${baseURL}/head/modify`, qs.stringify(params))
		.then((res) => res.data)
}

// 导入
export const uploadRecipe = (params = {}) => {
	// 文件上传
	return httpJ
		.post(`${baseURL}/meal/import_excel`, params, {
			headers: { 'Content-Type': 'multipart/form-data' }
		})
		.then((res) => res.data)
}
// 导出模板如下
export const exportUserDinnerListForMealTime = `${baseURL}/meal_record/export_segment_list?token=${store.state.vuex_user.token}`
